<div class="content-box" onMouseOver="javascript:display_content_box(this,'over');" onMouseOut="javascript:display_content_box(this,'out');">
   <table class="list" width="100%">
    <colgroup>
        <col />
        <col width="10%" />
        <col width="20%" />
        <col width="10%" />
    </colgroup>
    <tr>
        <th>
            제목</th>
        <th>
            이름</th>
        <th>
            날짜</th>
        <th>
            상태</th>
    </tr>
    <% for board_post in @board_posts %>
    <tr>
        <td style="text-align:left;padding-left:10px;">
	<%= link_to board_post.title, :action=>'show',:id=> board_post %>
        &nbsp;[<%= board_post.board_comment.count(['fl_enable = 1 OR ( user_id = ? and fl_enable = 0 )',session[:user_id]]) %>]
        </td>
        <td>
        <%= board_post.user[:name] %>
        </td>
        <td>
        <%= board_post.register_date.strftime("%Y-%m-%d") %>
        </td>
        <td>
        <%= board_post.fl_enable == 1 ? "사용" : "삭제" %>
        </td>
    </tr>
    <% end %>
    </table>
<%= link_to 'Previous page', { :page => @board_post_pages.current.previous } if @board_post_pages.current.previous %>
<%= link_to 'Next page', { :page => @board_post_pages.current.next } if @board_post_pages.current.next %> 

<br />
<div class="nav">
<%= link_to '등록', :action => 'new' %>
</div>
</div>
